CC = gcc
DIR_INC = ./include
DIR_SRC = ./src
DIR_OBJ = ./obj
DIR_BIN = ./bin
LDFLAG = -lpthread

SRC = $(wildcard ${DIR_SRC}/*.c)
OBJS = $(patsubst %.c,${DIR_OBJ}/%.o,$(notdir ${SRC}))

TARGET = ${DIR_BIN}/server
CFLAGS = -g -Wall -I${DIR_INC}

$(TARGET):$(OBJS)
	$(CC) $(OBJS) $(LDFLAG) -o $@

${DIR_OBJ}/%.o:${DIR_SRC}/%.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm $(TARGET) $(OBJS)
.PHONY:clean

